Repository navigation
fix(objectql, lint): synced objects are told to drop write verbs, not to open userActions - #33517
Conversation
… to open userActions On a managedBy 'synced' object the parse refuses a userActions entry that opens a write (ADR-0153 D4), yet the registry's stripped-apiMethods warning and the object/managed-api-method-unaffordable finding both prescribed exactly that. Both now branch on MANAGED_BY_WRITE_LOCKED_BUCKETS: on synced they name the verbs to remove from enable.apiMethods and point writes at a declared action (ADR-0153 D5). Every other bucket keeps today's sentence. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5p6qE7Nt8wpjSGLqiC
📓 Docs Drift CheckThis PR changes 2 package(s): 1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 1 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 25 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 1640779d9bbd5f950225b89b2923b76e87625103 && git checkout 1640779d9bbd5f950225b89b2923b76e87625103
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin e40cd1e28dd79e60e7f4be0db06f071f3f962574 f127667d57f892250715fef4164103bc13274403 && git checkout -B drift-repro e40cd1e28dd79e60e7f4be0db06f071f3f962574 && git merge --no-ff f127667d57f892250715fef4164103bc13274403
node scripts/docs-audit/affected-docs.mjs --json e40cd1e28dd79e60e7f4be0db06f071f3f962574
|
|
domain:spec#1 · os-project-manager · session_01FEkQ5mswnWm181XgYcCUag ACCEPT · PR #33517 (#32134) · head
|
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 43665114269 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
Requested by Leehom · project thread
domain:spec#1 · os-project-manager · session_01FEkQ5p6qE7Nt8wpjSGLqiC
Fixes #32134
Clause-②: no
Metadata-protocol: none
维护者速读
managedBy: 'synced'对象上,注册时剥除写动词的告警和 lint 规则object/managed-api-method-unaffordable的报错/修复行,不再让作者去userActions打开写权限,改为:列出要从enable.apiMethods删掉的动词,写入走声明的 action(ADR-0153 D5)。os explain多一段说明。其他 bucket 的文字逐字不变。synced对象上userActions打开写动词会在 parse 时被拒(ADR-0153 D4)。旧文案让作者去改userActions,改完构建又报错,两条信息互相矛盾,作者无路可走。packages/lint/src/validate-managed-api-methods.ts的writeLocked分支;packages/objectql/src/registry.tsreconcileManagedApiMethods的remedy。pnpm --filter @objectstack/lint exec vitest run src/validate-managed-api-methods.test.ts,预期 15 条全绿(含 synced 的两条新钉子)。What changes
Both sentences branch on
MANAGED_BY_WRITE_LOCKED_BUCKETS(@objectstack/spec/data, todaysyncedalone), the same set the parse refusal (refuseWriteLockedUserActions),resolveCrudAffordancesand the core/me/permissionsclamp already read, so the remedy text and the refusal can never disagree about which bucket is locked.packages/objectql/src/registry.tsreconcileManagedApiMethods. On a write-locked bucket the warning's remedy reads: "userActions cannot open a write on this bucket (ADR-0153 D4): remove [VERBS] from enable.apiMethods and send writes through a declared action (ADR-0153 D5)." Every other bucket keeps "Declare userActions to open a verb the object legitimately takes from a user context." The rest of the line (object, bucket, stripped and kept verbs, the lint rule id) and the strip are unchanged.packages/lint/src/validate-managed-api-methods.ts(object/managed-api-method-unaffordable). On a write-locked bucket the verdict reads "enable.apiMethodsadvertises [VERBS], whichmanagedBy: 'synced'refuses, anduserActionscannot open a write there, so the registry strips them", and the fix line reads "Remove [VERBS] fromenable.apiMethods, and send writes through a declared action". Every other bucket keeps "(needs userActions …)" and both ways out. Rule id, severity,where,pathand the verdict itself are unchanged.packages/lint/src/rule-explanations.ts.os explain object/managed-api-method-unaffordablegains one paragraph: onsynceduserActionscannot open a write (ADR-0153 D4), so the fix line offers only the removal, and a write goes through a declared action (ADR-0153 D5)..changeset/32134-synced-remedy-text.md:@objectstack/objectqlpatch,@objectstack/lintpatch. Both packages shipdist/(files: [dist, README.md, CHANGELOG.md]); the new text is inpackages/objectql/dist/index.jsandpackages/lint/dist/index.jsafter build.File surface. The order named
managed-api-affordance.ts'sdescribeManagedApiMethodConflictsas the lint sentence's source. Measured onorigin/mainf068cde8: the lint rule no longer reads it (it builds its own message and hint,validate-managed-api-methods.tsL110-114, and its CHANGELOG records the switch), and the helper has no production caller, only its own test. The seat amended the claim's surface to the lint rule, its test and the explain paragraph, and ruled the spec helper out of this PR (no parameter added to an export nobody calls). Nopackages/specfile moves, so there is no spec changeset.Tests
packages/objectql/src/registry.test.ts: asyncedfixture pins the whole warning line; a control onengine-ownedpins today's line byte for byte.packages/lint/src/validate-managed-api-methods.test.ts: asyncedfixture pins the whole verdict, and one with every write verb pins the whole fix line (and that it never saysuserActions); the existing exact pins onplatform(verdict) andbetter-auth(fix line) are the controls and are unchanged. The explanation's fact list gainsADR-0153 D4andADR-0153 D5. Both synced cases are recorded by the file's one-line, at-most-200-characters checks.Ablation: each synced branch forced off, red, restored (head f127667)
Both suites import the subject from
src/(./registry,./validate-managed-api-methods);MANAGED_BY_WRITE_LOCKED_BUCKETScomes from spec's builtdist/and was not mutated, so no rebuild sits in either leg.Control leg on the base:
registry.tsatf068cde8with this PR's test file,-t reconcileManagedApiMethods: only the synced pin fails (Tests 1 failed | 17 passed | 89 skipped), so the engine-owned control pins the linemainprints today. Restored,git diff HEADempty.Acceptance notes
describeManagedApiMethodConflicts(packages/spec/src/data/managed-api-affordance.tsL142-150) takes only the conflicts, which carry no bucket, and nothing in the platform calls it any more. Left as it is by the seat's ruling; reported to the seat to card.git grepfor the rule id and for "Declare userActions" overskills/,content/anddocs/answers nothing, so nothing is regenerated.Verification
On head
f127667d(branchclaude/project-thread-88rfao, merge baseorigin/mainf068cde8), each exit code captured before any pipe:pnpm --filter @objectstack/objectql --filter @objectstack/lint test(under the verify lock): exit 0; lint Test Files 210 passed (210), Tests 8973 passed (8973); objectql Test Files 595 passed (595), Tests 13013 passed (13013).pnpm --filter @objectstack/objectql --filter @objectstack/lint typecheck(tsc --noEmitpluscheck:test-typecheckovertsconfig.test.json): exit 0, no new pinned signature ("39 file(s) / 233 error(s) / 64 pinned signature(s) held" for objectql, "2 file(s) / 6 error(s) / 2 pinned signature(s) held" for lint).eslint --no-inline-configon the five changed source and test files: exit 0.Derived gates (
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack, 73 families): 72 exit 0;pnpm check:dual-build-cjs-loadsexit 3 PREREQUISITE NOT MET (needs every package'sdist/), NOT MEASURED, CI runs it.--ran: "73 derived famil(ies) accounted for — 72 run, 1 NOT-MEASURED".dispatch-gates --tier: no path-derived mandate; 121 changed lines, under the 3000 threshold; no governed surface.origin/mainmoved toe40cd1e2after the run; none of its commits touches the changed files orobject.zod.ts.CI families are read from this PR's check-runs, not re-run here.
🤖 Generated with Claude Code
https://claude.ai/code/session_01FEkQ5p6qE7Nt8wpjSGLqiC